<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" xmlns:head="http://www.w3.org/1999/html">
<head th:include="public/public_css::public_css ('退货管理')"/>

<body style="background-color: #f2f2f2;">
<div class="layui-fluid larry-wrapper">
    <div class="layui-card">
        <div class="layui-row layui-col-space30">
            <div class="layui-col-xs24">
                <form class="layui-form layui-card-header  layui-card-header-auto" id="searchForm">
                    <div class="layui-inline">
                        <label class="layui-form-label">退货单号</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="thdh" id="thdh" placeholder="请输入退货单号"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">退货入库单号</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="rkdh" id="rkdh" placeholder="请输入退货入库单号"/>
                        </div>
                    </div>
                    <div class="layui-inline inline-search-btn">
                        <a class="layui-btn layui-btn-normal search_btn" lay-event="searchEvent" data-type="reload">查询</a>
                    </div>
                    <div class="layui-inline inline-reset-btn">
                        <button type="reset" class="layui-btn layui-btn-normal" >重置</button>
                    </div>
                </form>
                <div class="group-button tpl-button" id="toolbar">
                </div>
                <!--列表-->
                <section class="panel panel-padding layui-card-body">
                    <div class="pro">
                        <table id="table"></table>
                    </div>
                </section>
            </div>
        </div>
    </div>
</div>

</body>


<div th:include="public/public_js::public_js"></div>
<div th:include="public/public_btn::public_btn"></div>
<script th:inline="javascript">
    var functions = [[${functions}]];
    layui.use(['list', 'layer', 'zzpUtils', 'jquery', 'laydate', 'tablebutton'], function () {
        var zzpUtils = layui.zzpUtils,
            $ = layui.jquery,
            laydate = layui.laydate,
            tablebtn = layui.tablebutton;
        var $table;
        tablebtn.buildOnClick({
            type: 1,
            temp: $("#function_tpl"),
            functions: functions.headBtn,
            row: null,
            event: {
                addEvent: function (data) {
                    add();
                }
            }
        });
        //新增
        function add() {
            zzpUtils.dialog({
                title: "新增退货单",
                type: 2,
                content: "/inOperation/addReturnGoods",
                end: function () {//增加成功后刷新
                    zzpUtils.refreshTable("#table");
                }
            });
        }
        laydate.render({
            elem: '#test5'
            , theme: '#20a0ff'
        })
        $table = zzpUtils.table({
            elem: '#table',
            isApi: true,
            isOperate: true,
            pagination: true,
            url: '/wmsRejected/list',
            columns: [{
                field: 'thdh',
                title: '退货单号'
            }, {
                field: 'rkdh',
                title: '退货入库单号'
            }, {
                field: 'wldh',
                title: '退货物流单号'
            }, {
                field: 'bz',
                title: '备注'
            }],
            queryParams: function () {//查询条件
                return zzpUtils.getFormJson($("#searchForm"));
            },
            detailFormatter: function (index, row) {
                return "这里就没有确定过11";
            }
        });

        //查询
        $(".inline-search-btn").on('click', function () {
            zzpUtils.refreshTable("#table");
        })
    });
</script>
</html>